import request from "@/utils/request";

/**
 * 分页查询圈子
 * @param param
 * @returns {AxiosPromise}
 */
export function page(param) {
    return request({
        url: '/circle/page',
        method: 'get',
        params: param
    })
}

/**
 * 查询圈子关注用户列表
 * @param param
 * @returns {AxiosPromise}
 */
export function pageByCircleUuid(param, uuid) {
    return request({
        url: '/circle-follow/page/' + uuid,
        method: 'get',
        params: param
    })
}

/**
 * 启用圈子
 * @param uuid
 * @returns {AxiosPromise}
 */
export function enable(uuid) {
    return request({
        url: '/circle/enable/' + uuid,
        method: 'put',
    })
}

/**
 * 禁用圈子
 * @param uuid
 * @returns {AxiosPromise}
 */
export function disable(uuid) {
    return request({
        url: '/circle/disable/' + uuid,
        method: 'put',
    })
}

/**
 * 删除圈子
 * @param uuid
 * @returns {AxiosPromise}
 */
export function deleted(uuid) {
    return request({
        url: '/circle/delete/' + uuid,
        method: 'delete',
    })
}

/**
 * 导出圈子
 * @returns {*}
 */
export function exportCircle(param) {
    return request({
        url: '/circle/export',
        method: 'post',
        params: param,
        responseType: 'blob'
    })
}

/**
 * 批量启用
 * @returns {*}
 */
export function batchEnable(param) {
    return request({
        url: '/circle/batch-enable',
        method: 'put',
        data: param,
    })
}

/**
 * 批量禁用
 * @returns {*}
 */
export function batchDisable(param) {
    return request({
        url: '/circle/batch-disable',
        method: 'put',
        data: param,
    })
}

/**
 * 批量删除
 * @returns {*}
 */
export function batchDelete(param) {
    return request({
        url: '/circle/batch-delete',
        method: 'delete',
        data: param,
    })
}

/**
 * 通过审核
 * @returns {*}
 */
export function pass(param) {
    return request({
        url: '/circle/pass/' + param.uuid,
        method: 'put',
        data: param
    })
}

/**
 * 未通过审核
 * @returns {*}
 */
export function noPass(param) {
    return request({
        url: '/circle/no-pass/' + param.uuid,
        method: 'put',
        data: param
    })
}

/**
 * 圈子详情
 * @returns {*}
 */
export function detail(uuid) {
    return request({
        url: '/circle/detail/' + uuid,
        method: 'get',
    })
}